﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.Text.LookaheadToken
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

namespace System.Web.Razor.Text
{
  /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the token to look for the razor.</summary>
  public class LookaheadToken : IDisposable
  {
    private Action _cancelAction;
    private bool _accepted;

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Text.LookaheadToken" /> class.</summary>
    /// <param name="cancelAction">The action to cancel.</param>
    public LookaheadToken(Action cancelAction) => this._cancelAction = cancelAction;

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token.</summary>
    public void Accept() => this._accepted = true;

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the resources used by the current instance of the <see cref="T:System.Web.Razor.Text.LookaheadToken" /> class.</summary>
    public void Dispose()
    {
      this.Dispose(true);
      GC.SuppressFinalize((object) this);
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the <see cref="T:System.Web.Razor.Text.LookaheadToken" /> and optionally releases the managed resources.</summary>
    /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
    protected virtual void Dispose(bool disposing)
    {
      if (this._accepted)
        return;
      this._cancelAction();
    }
  }
}
